<template>
  <div>
    <h2>One:{{ count }}</h2>
    <button @click="addCount">count累加</button>
  </div>
</template>

<script>
export default {
  name: "One",
  data() {
    return {
      count: 0,
    };
  },
  methods: {
    addCount() {
      this.count++;
    },
  },
  mounted() {
    console.log("初始化mounted");
  },

  beforeDestroy() {
    console.log("销毁");
  },
  watch: {
    count() {
      console.log("count改变了");
    },
  },
};
</script>

<style></style>
